package com.groupsix.service.impl;

import com.groupsix.mapper.SysUserMapper;
import com.groupsix.pojo.SysUser;
import com.groupsix.service.SysUserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class SysUserServiceImpl implements SysUserService {
    @Autowired
    private SysUserMapper sysUserMapper;

    /**
     *  登录操作 根据tel查询用户全部信息
     * @param tel  用户tel
     * @return     用户全部信息
     */
    @Override
    public SysUser findUserInfoByTel(String tel) {
        SysUser userInfo = sysUserMapper.findUserInfoByTel(tel);
        return userInfo;
    }

    /**
     * 注册操作
     * @param sysUser 用户输入信息
     * @return  true注册成功  false注册失败
     */
    @Override
    public boolean addUser(SysUser sysUser) {
        int i = sysUserMapper.addUser(sysUser);
        if (i>-1){
            return true;
        }
        return false;
    }
}
